home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 11UR7XY (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  3.2 KB  |  88 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import java.io.IOException;
  4. import java.io.ObjectInputStream;
  5. import java.io.ObjectOutputStream;
  6.  
  7. public class AbstractDocument$LeafElement extends AbstractDocument.AbstractElement {
  8.    // $FF: synthetic field
  9.    AbstractDocument this$0;
  10.    // $FF: renamed from: p0 com.sun.java.swing.text.Position
  11.    private transient Position field_0;
  12.    // $FF: renamed from: p1 com.sun.java.swing.text.Position
  13.    private transient Position field_1;
  14.  
  15.    // $FF: synthetic method
  16.    public AbstractDocument$LeafElement(AbstractDocument this$0, Element parent, AttributeSet a, int offs0, int offs1) {
  17.       super(this$0, parent, a);
  18.       this.this$0 = this$0;
  19.  
  20.       try {
  21.          this.field_0 = this$0.createPosition(offs0);
  22.          this.field_1 = this$0.createPosition(offs1);
  23.       } catch (BadLocationException var6) {
  24.          this.field_0 = null;
  25.          this.field_1 = null;
  26.          throw new StateInvariantError("Can't create Position references");
  27.       }
  28.    }
  29.  
  30.    public String toString() {
  31.       return "LeafElement(" + this.getName() + ") " + this.field_0 + "," + this.field_1 + "\n";
  32.    }
  33.  
  34.    public int getStartOffset() {
  35.       return this.field_0.getOffset();
  36.    }
  37.  
  38.    public int getEndOffset() {
  39.       return this.field_1.getOffset();
  40.    }
  41.  
  42.    public String getName() {
  43.       String nm = super.getName();
  44.       if (nm == null) {
  45.          nm = "content";
  46.       }
  47.  
  48.       return nm;
  49.    }
  50.  
  51.    public int getElementIndex(int pos) {
  52.       return -1;
  53.    }
  54.  
  55.    public Element getElement(int index) {
  56.       return null;
  57.    }
  58.  
  59.    public int getElementCount() {
  60.       return 0;
  61.    }
  62.  
  63.    public boolean isLeaf() {
  64.       return true;
  65.    }
  66.  
  67.    private void writeObject(ObjectOutputStream s) throws IOException {
  68.       s.defaultWriteObject();
  69.       s.writeInt(this.field_0.getOffset());
  70.       s.writeInt(this.field_1.getOffset());
  71.    }
  72.  
  73.    private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
  74.       s.defaultReadObject();
  75.       int off0 = s.readInt();
  76.       int off1 = s.readInt();
  77.  
  78.       try {
  79.          this.field_0 = this.this$0.createPosition(off0);
  80.          this.field_1 = this.this$0.createPosition(off1);
  81.       } catch (BadLocationException var4) {
  82.          this.field_0 = null;
  83.          this.field_1 = null;
  84.          throw new IOException("Can't restore Position references");
  85.       }
  86.    }
  87. }
  88.